package entity;

import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import org.hibernate.annotations.GenericGenerator;

/**
 * Evenement entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "evenement", schema = "public")
public class Evenement implements java.io.Serializable {

	// Fields

	private Integer id;
	private String titre;
	private Date date;
	private Date heureFin;
	private String heureDebut;
	private Set<Typeb> typebs = new HashSet<Typeb>(0);
	private Set<Vente> ventes = new HashSet<Vente>(0);
	private Set<TypeBillet> typeBillets = new HashSet<TypeBillet>(0);

	// Constructors

	/** default constructor */
	public Evenement() {
	}

	/** full constructor */
	public Evenement(String titre, Date date, Date heureFin, String heureDebut,
			Set<Typeb> typebs, Set<Vente> ventes, Set<TypeBillet> typeBillets) {
		this.titre = titre;
		this.date = date;
		this.heureFin = heureFin;
		this.heureDebut = heureDebut;
		this.typebs = typebs;
		this.ventes = ventes;
		this.typeBillets = typeBillets;
	}

	// Property accessors
	@GenericGenerator(name = "generator", strategy = "increment")
	@Id
	@GeneratedValue(generator = "generator")
	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@Column(name = "titre")
	public String getTitre() {
		return this.titre;
	}

	public void setTitre(String titre) {
		this.titre = titre;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "date", length = 13)
	public Date getDate() {
		return this.date;
	}

	public void setDate(Date date) {
		this.date = date;
	}

	@Column(name = "heure_fin", length = 21)
	public Date getHeureFin() {
		return this.heureFin;
	}

	public void setHeureFin(Date heureFin) {
		this.heureFin = heureFin;
	}

	@Column(name = "heure_debut")
	public String getHeureDebut() {
		return this.heureDebut;
	}

	public void setHeureDebut(String heureDebut) {
		this.heureDebut = heureDebut;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "evenement")
	public Set<Typeb> getTypebs() {
		return this.typebs;
	}

	public void setTypebs(Set<Typeb> typebs) {
		this.typebs = typebs;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "evenement")
	public Set<Vente> getVentes() {
		return this.ventes;
	}

	public void setVentes(Set<Vente> ventes) {
		this.ventes = ventes;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "evenement")
	public Set<TypeBillet> getTypeBillets() {
		return this.typeBillets;
	}

	public void setTypeBillets(Set<TypeBillet> typeBillets) {
		this.typeBillets = typeBillets;
	}

}